<%@include file="../context.jsp"%>
<form:form method="POST" commandName="criteria"
	action="${pageContext.request.contextPath}/admin/${param.page}/search.html">
	<form:input cssClass="datepicker" path="fromDate" id="fromDatepicker" />
	<form:input cssClass="datepicker" path="toDate" id="toDatepicker" />
	<form:select cssClass="searchSelector" path="sectorId">
		<form:option value="-1">--ANY--</form:option>
		<form:options itemValue="id" itemLabel="name" items="${sectorsMap}" />
	</form:select>

	<input class="btnSerch btn-info" type="submit" value="Search" />
	<input id="reset_btn" class="btnSerch btn-info" type="submit"
		value="Reset" />
</form:form>
<jsp:include page="common_link.jsp" />

<script type="text/javascript">
	$(document).ready(
			function() {
				$("#reset_btn").on(
						"click ",
						function() {
							$(".datepicker").val("");
							$(".searchSelector").val("");
							if ($('.datepicker').is(':empty')
									&& $('.searchSelector').is(':empty')) {
								$("#form_id").submit();
							}

						});

			});
</script>
